#include<fstream>
#include<cstdlib>
#include<iostream>
#include<time.h>
using namespace std;


/**
 * @brief main generate matrices ranging from -100 to 100
 *
 * @param args number of params
 * @param argv[] 1: row number 2: col number 3: Matrix<int> address 4: Matrix<double> address
 *
 * @return default 0
 */
int main(int args, char* argv[]){
	srand(time(0));
	ofstream intfile;
	intfile.open(argv[3]);
	if(intfile.fail()){
		cout << "Open Error!" << endl;
		exit(0);
	}
	intfile << (*argv[1]-'0') << " " << (*argv[2]-'0') << endl;
	for(int i=0; i< (*argv[1]-'0'); ++i){
		for(int j=0; j< (*argv[2]-'0'); ++j){
			intfile << (rand()%201-100) << " "; 
		}
	}
	
	intfile.close();
	
	ofstream doublefile;
	doublefile.open(argv[4]);
	if(doublefile.fail()){
		cout << "Open Error!" << endl;
		exit(0);
	}
	doublefile << (*argv[1]-'0') << " " << (*argv[2]-'0') << endl;
	for(int i=0; i<(*argv[1]-'0'); ++i){
		for(int j=0; j<(*argv[2]-'0'); ++j){
			doublefile << (double)(rand()%2001-1000)/10 << " ";
		}
	}
	doublefile.close();
	return 0;


}
